<?php
/**
 * Created by PhpStorm.
 * User: Guangpeng Chen
 * Date: 10-10/0010
 * Time: 15:26
 *
 */
define('ROOT_PATH','/var/www/html/new/d/');
define('FX_PATH', ROOT_PATH.'class/');
include ROOT_PATH . 'common/autoload.php';

$did = 94;
$title = safetxt($_REQUEST['title']);
$note  = safetxt($_REQUEST['note']);
$perc  = intval($_REQUEST['dpercent']);
$dpt   = intval($_REQUEST['dptype']);
$mtype = intval($_REQUEST['mtype']);

eval('$defaultCfg ='.$_REQUEST['defaultCfg'].';');
if (!empty($_REQUEST['specialCfg'])) {
    eval('$specialCfg ='. $_REQUEST['specialCfg'].';');
}


print_r($defaultCfg);
print_r($specialCfg);
exit;
$tpl = Tpl::getLink();
$lastid = $tpl->saveTpl($did, $title, $defaultCfg, $perc, $dpt, $specialCfg, $mtype,$note );
echo $lastid;